package com.biz.primus.ms.geo.dao.ro;


import com.biz.primus.base.redis.annotation.Ro;
import com.biz.primus.base.redis.annotation.RoSortedSet;
import com.biz.primus.ms.geo.dao.po.City;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author shenjiahao
 * @since 2016年9月1日
 */
@Ro(key = "geo:city")
@RoSortedSet(key = "list", score = "id")
@Getter
@Setter
@NoArgsConstructor
public class CityRo extends AbstractAreaRo implements Comparable<CityRo> {

    private static final long serialVersionUID = -2612350271589070735L;

    /**
     *省id
     */
    private Integer provinceId;


    public CityRo(City po) {
        super(po);
        this.setProvinceId(po.getProvinceId());
    }

    @Override
    public int compareTo(CityRo o) {
        return this.prefix.compareTo(o.prefix);
    }
}
